 package tools.packet;

 import handling.opcode.SendPacketOpcode;
 import java.util.Iterator;
 import java.util.List;
 import server.FairyDust;
 import tools.data.output.MaplePacketLittleEndianWriter;







 public class LucidPacket
 {
   public static byte[] createDragon(int phase, int posX, int posY, int createPosX, int createPosY, boolean isLeft) {
/*  18 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
/*  19 */     mplew.writeShort(SendPacketOpcode.LUCID_CREATE_DRAGON.getValue());
/*  20 */     mplew.writeInt(phase);
/*  21 */     mplew.writeInt(posX);
/*  22 */     mplew.writeInt(posY);
/*  23 */     mplew.writeInt(createPosX);
/*  24 */     mplew.writeInt(createPosY);
/*  25 */     mplew.writeBool(isLeft);
/*  26 */     return mplew.getPacket();
   }




   public static byte[] doFlowerTrapSkill(int level, int pattern, int x, int y, boolean flip) {
/*  33 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
/*  34 */     mplew.writeShort(SendPacketOpcode.LUCID_USE_SKILL.getValue());
/*  35 */     mplew.writeInt(238);
/*  36 */     mplew.writeInt(level);
/*  37 */     mplew.writeInt(pattern);
/*  38 */     mplew.writeInt(x);
/*  39 */     mplew.writeInt(y);
/*  40 */     mplew.writeBool(flip);
/*  41 */     return mplew.getPacket();
   }




   public static byte[] LaserRainSkill(int startDelay, List<Integer> intervals) {
/*  48 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
/*  49 */     mplew.writeShort(SendPacketOpcode.LUCID_USE_SKILL.getValue());
/*  50 */     mplew.writeInt(238);
/*  51 */     mplew.writeInt(5);
/*  52 */     mplew.writeInt(startDelay);
/*  53 */     mplew.writeInt(intervals.size());
/*  54 */     for (Iterator<Integer> iterator = intervals.iterator(); iterator.hasNext(); ) { int interval = ((Integer)iterator.next()).intValue();
/*  55 */       mplew.writeInt(interval); }

/*  57 */     return mplew.getPacket();
   }




   public static byte[] doFairyDustSkill(int level, List<FairyDust> fairyDust) {
/*  64 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
/*  65 */     mplew.writeShort(SendPacketOpcode.LUCID_USE_SKILL.getValue());
/*  66 */     mplew.writeInt(238);
/*  67 */     mplew.writeInt(level);
/*  68 */     mplew.writeInt(fairyDust.size());
/*  69 */     for (FairyDust fd : fairyDust) {
/*  70 */       mplew.writeInt(fd.getScale());
/*  71 */       mplew.writeInt(fd.getCreateDelay());
/*  72 */       mplew.writeInt(fd.getMoveSpeed());
/*  73 */       mplew.writeInt(fd.getAngle());
     }
/*  75 */     return mplew.getPacket();
   }




   public static byte[] ShowSteps(boolean enable, List<String> tags) {
/*  82 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
/*  83 */     mplew.writeShort(SendPacketOpcode.LUCID_SHOW_STEPS.getValue());
/*  84 */     mplew.writeBool(enable);
/*  85 */     mplew.writeInt(tags.size());
/*  86 */     for (String name : tags) {
/*  87 */       mplew.writeMapleAsciiString(name);
     }
/*  89 */     return mplew.getPacket();
   }




   public static byte[] changeStatueState(boolean placement, int gauge, boolean enable) {
/*  96 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
/*  97 */     mplew.writeShort(SendPacketOpcode.LUCID_STATUE_STATE_CHANGE.getValue());
/*  98 */     mplew.writeInt(placement ? 1 : 0);
/*  99 */     if (placement) {
/* 100 */       mplew.writeBool(enable);
     } else {
/* 102 */       mplew.writeInt(gauge);
/* 103 */       mplew.writeBool(enable);
     }
/* 105 */     return mplew.getPacket();
   }




   public static byte[] setFlyingMode(boolean value) {
/* 112 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
/* 113 */     mplew.writeShort(SendPacketOpcode.LUCID_FLYING_MODE.getValue());
/* 114 */     mplew.writeBool(value);
/* 115 */     return mplew.getPacket();
   }




   public static byte[] UseScreenShoot(int type, int angle, int speed) {
/* 122 */     MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
/* 123 */     mplew.writeShort(SendPacketOpcode.LUCID_SCREEN_ATK.getValue());
/* 124 */     mplew.writeInt(type);
/* 125 */     if (type != 2) {
/* 126 */       mplew.writeInt(angle);
/* 127 */       mplew.writeInt(speed);
/* 128 */       mplew.writeInt(113);
/* 129 */       mplew.writeInt(33);
/* 130 */       mplew.writeInt(1077);
/* 131 */       mplew.writeInt(16);
/* 132 */       mplew.writeInt(15);
/* 133 */       mplew.writeInt(2);
     }
/* 135 */     return mplew.getPacket();
   }
 }